package dao

import (
	"zk3/global"
	"zk3/internal/model"
)

func GetUserBy(username string) model.User {
	var user model.User
	if err := global.DB.Where("user_name=?", username).Limit(1).First(&user).Error; err != nil {
		return model.User{}
	}
	return user
}
